<template>
  <div id="loading">
    <div id="circle">
      <div class="right load"></div>
    </div>
    <!-- <img src="../../static/icon/kaoqin.png" alt="加载中…" class="load-img" /> -->
    <image src="../../static/icon/edit.png" alt="加载中…" class="load-img" />
  </div>
</template>

<script>
export default {
  name: "Loading",
  data() {
    return {};
  },
  // onLoad() {
  //   var expreTIme = wx.getStorageSync("key");
  //   if (expreTIme === 1) {
  //     wx.switchTab({
  //       url: "/pages/work/main",
  //     });
  //   } else {
  //     wx.navigateTo({
  //       url: "/pages/login/main",
  //     });
  //   }
  // },
  onShow() {
    var expreTIme = wx.getStorageSync("key");
    if (expreTIme === 1) {
      wx.switchTab({
        url: "/pages/work/main",
      });
    } else {
      wx.navigateTo({
        url: "/pages/login/main",
      });
    }
  },
};
</script>

<style scoped>
#loading {
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background-color: #fff;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
}
.load-img {
  width: 80px;
  height: 80px;
  position: absolute;
  left: 50%;
  top: 45%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}
#circle {
  width: 95px;
  height: 95px;
  border-width: 0;
  position: absolute;
  left: 50%;
  top: 45%;
  border-radius: 50%;
  transform: translate(-50%, -50%);
}
.load {
  position: absolute;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  border: 2px solid #d81e06;
  box-sizing: border-box;
  z-index: 2;
}
#circle .right {
  border-right-color: rgba(0, 0, 0, 0);
  border-bottom-color: rgba(0, 0, 0, 0);
}

#circle .right {
  animation: right-animation 2s linear infinite;
}

@keyframes right-animation {
  from {
    transform: rotate(0deg);
  }
  to {
    transform: rotate(360deg);
  }
}
</style>
